package com.sf.fy.uav.order.controller;

import com.sf.fy.uav.common.request.order.BillAddRequest;
import com.sf.fy.uav.common.utils.Rs;
import com.sf.fy.uav.order.entity.Bill;
import com.sf.fy.uav.order.service.IBillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2023-07-03
 */
@RestController
@RequestMapping("/sys/bill")
public class BillRest {

    @Autowired
    private IBillService iBillService;

    @PostMapping("add")
    public void add(BillAddRequest billAddRequest) {
        iBillService.add(billAddRequest);
    }


    public Bill getByTcWaybillNo(String tcWaybillNo, Integer payStatus) {
        return iBillService.getByTcWaybillNo(tcWaybillNo, payStatus);
    }

    public Bill getByTcWaybillNoAndType(String tcWaybillNo, Integer type) {
        return iBillService.getByTcWaybillNoAndType(tcWaybillNo, type);
    }

    public Rs<Boolean> billSettlement(BillAddRequest billAddRequest) {
        return iBillService.billSettlement(billAddRequest);
    }
}
